﻿@section PageTitle { Color Key Filter }
@section SubTitle { Makes a specified color transparent in the output image }

<div class="alert alert-info">You can also use the top-left pixel in the source image as the transparent color</div>

<pre class="prettyprint">
&lt;div style="background-color:Red;width:130px;height:130px;padding-left:30px;padding-top:30px"&gt;
	&lt;p&gt;
		@@Html.DynamicImageTag(b => b.ImageFormat(DynamicImageFormat.Png).FillBackgroundColor(Colors.Transparent).WithLayer(
			LayerBuilder.Image.SourceFile("~/Assets/Images/bmw.jpg")
				.WithFilter(FilterBuilder.ColorKey.Color(Colors.White).ColorTolerance(5))
		))
	&lt;/p&gt;
&lt;/div&gt;
</pre>

<div style="background-color:Red;width:130px;height:130px;padding-left:30px;padding-top:30px">
	<p>
		@Html.DynamicImageTag(b => b.ImageFormat(DynamicImageFormat.Png).FillBackgroundColor(Colors.Transparent).WithLayer(
			LayerBuilder.Image.SourceFile("~/Assets/Images/bmw.jpg")
				.WithFilter(FilterBuilder.ColorKey.Color(Colors.White).ColorTolerance(5))
		))
	</p>
</div>